//等比缩放元素尺寸
//区域内缩放
function fitSize(mc, _W, _H) {

	var W, H, X, Y;
	var mcW = mc.width;
	var mcH = mc.height;
	var NewWidth = _H / mcH * mcW;
	if (NewWidth < _W) {
		W = NewWidth;
		H = _H;
	} else {
		W = _W;
		H = _W / mcW * mcH;
	}
	//计算宽高变化后的坐标，仅以相对左上角为准
	X = (_W - W) * 0.5;
	Y = (_H - H) * 0.5;
	return { w: W, h: H, x: X, y: Y }
}
//撑满缩放
function fullSize(mc, _W, _H) {

	var W, H, X, Y;
	var mcW = mc.width;
	var mcH = mc.height;
	var NewWidth = _H / mcH * mcW;
	if (NewWidth > _W) {
		W = NewWidth;
		H = _H;
	} else {
		W = _W;
		H = _W / mcW * mcH;
	}
	//计算宽高变化后的坐标，仅以相对左上角为准
	X = (_W - W) * 0.5;
	Y = (_H - H) * 0.5;
	return { w: W, h: H, x: X, y: Y }
}